#include <bits/stdc++.h>

using namespace std;

class Solution
{
public:
    int hash1[26] = {0};
    int hash2[26] = {0};
    bool isAnagram(string s, string t)
    {
        for (int i = 0; i < s.size(); ++i)
        {
            ++hash1[s[i] - 'a'];
        }
        for (int j = 0; j < t.size(); ++j)
        {
            ++hash2[t[j] - 'a'];
        }
        for (int i = 0; i < 26; ++i)
        {
            if (hash1[i] != hash2[i])
            {
                return false;
            }
        }
        return true;
    }
};
